package com.qingzhuge.manager.dto.request;


import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.qingzhuge.common.enums.ESexType;
import com.qingzhuge.common.validator.AddGroup;
import com.qingzhuge.common.validator.UpdateGroup;
import com.qingzhuge.dto.request.BaseRequestPkLongDto;
import com.qingzhuge.manager.entity.SysRole;
import com.qingzhuge.resource.entity.SysResource;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * @author : zero.xiao
 * @description : 系统用户
 * @date :2018/6/8 0008 下午 15:02
 * @modified :
 * @since : 1.0.0
 */
@Getter
@Setter
@ApiModel("系统账号")
public class SysUserRequestDto extends BaseRequestPkLongDto {
    private static final long serialVersionUID = 6726754030355343274L;
    @ApiModelProperty("超级用户，只能有一个")
    private Boolean root;
    @ApiModelProperty("用户名")
    @NotBlank(message = "用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String username;
    @ApiModelProperty("密码")
    private String password;
    @ApiModelProperty("角色")
    private List<SysRole> roles = Lists.newArrayList();
    @ApiModelProperty("权限")
    private Set<SysResource> resources = Sets.newConcurrentHashSet();
    @ApiModelProperty("部门ID")
    private Long deptId;
    @ApiModelProperty("邮箱")
    private String email;
    @ApiModelProperty("性别")
    private ESexType sex;
    @ApiModelProperty("头像")
    private String avatar;
    @ApiModelProperty("手机号")
    private String mobile;
    @ApiModelProperty("身份证号码")
    private String idCardNumber;
    @ApiModelProperty("微信")
    private String weiXin;
    @ApiModelProperty("微博")
    private String weiBo;
    @ApiModelProperty("QQ")
    private String qq;
    @ApiModelProperty("出生日期")
    private Date birthDay;
    @ApiModelProperty("职位")
    private String position;
    @ApiModelProperty("详细地址")
    private String address;
    @ApiModelProperty("工号")
    private String staffNo;
    @ApiModelProperty("用户权限")
    private String permission;
}
